home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Developer Essentials / MPW Interfaces & Libraries / AIncludes / ScriptEqu.a < prev    next >
Encoding:
Text File  |  1992-01-29  |  49.5 KB  |  1,444 lines  |  [TEXT/MPS ]

  1. ; Version: 3.18
  2. ; Created: Friday, October 20, 1989 at 9:46:43 PM
  3. ;
  4. ; File ScriptEqu.a
  5. ;
  6. ; Assembler Interface to the Macintosh Libraries
  7. ; Copyright Apple Computer, Inc. 1986-1991
  8. ; All Rights Reserved
  9. ;
  10. ; -----------------------------------------------------------------------------
  11. ; Script Manager equates file.
  12. ;
  13. ; This file contains all equates for the script environment, shared
  14. ; equates for the script interface systems, equates that are special for
  15. ; the Roman Interface System, and all equates for the script interface
  16. ; system package.
  17. ; -----------------------------------------------------------------------------
  18. ;
  19.  
  20.     IF &TYPE('__IncludingScriptEqu__') = 'UNDEFINED' THEN
  21. __IncludingScriptEqu__    SET    1
  22.  
  23.     IF &TYPE('__IncludingTraps__') = 'UNDEFINED' THEN   ;for _ScriptUtil,_ReadXPRam,_WriteXPRam
  24.     INCLUDE 'Traps.a'
  25.     ENDIF
  26. ; -----------------------------------------------------------------------------
  27.  
  28. ; Script System constants.
  29.  
  30. smSystemScript    EQU            -1                        ; designates system script                <23>
  31. smCurrentScript    EQU            -2                        ; designates current font script        <27><33>
  32. smAllScripts    EQU            -3                        ; designates any script                    <39>
  33.  
  34. smRoman           EQU         0                         ; Roman
  35. smJapanese        EQU         1                         ; Japanese
  36. smTradChinese     EQU         2                         ; Traditional Chinese                    <14>
  37. smKorean          EQU         3                         ; Korean
  38. smArabic          EQU         4                         ; Arabic
  39. smHebrew          EQU         5                         ; Hebrew
  40. smGreek           EQU         6                         ; Greek
  41. smCyrillic        EQU            7                        ; Cyrillic                                <3>
  42. smRSymbol         EQU         8                         ; Right-left symbols
  43. smDevanagari      EQU         9                         ; Devanagari
  44. smGurmukhi        EQU         10                        ; Gurmukhi
  45. smGujarati        EQU         11                        ; Gujarati
  46. smOriya           EQU         12                        ; Oriya
  47. smBengali         EQU         13                        ; Bengali
  48. smTamil           EQU         14                        ; Tamil
  49. smTelugu          EQU         15                        ; Telugu
  50. smKannada         EQU         16                        ; Kannada/Kanarese
  51. smMalayalam       EQU         17                        ; Malayalam
  52. smSinhalese       EQU         18                        ; Sinhalese
  53. smBurmese         EQU         19                        ; Burmese
  54. smKhmer           EQU         20                        ; Khmer/Cambodian
  55. smThai            EQU         21                        ; Thai
  56. smLaotian         EQU         22                        ; Laotian
  57. smGeorgian        EQU         23                        ; Georgian
  58. smArmenian        EQU         24                        ; Armenian
  59. smSimpChinese   EQU         25                        ; Simplified Chinese                    <14>
  60. smTibetan         EQU         26                        ; Tibetan
  61. smMongolian       EQU         27                        ; Mongolian
  62. smGeez            EQU            28                        ; Geez/Ethiopic                            <1.6>
  63. smEthiopic        EQU            28                        ; Synonym for smGeez                    <20>
  64. smEastEurRoman    EQU         29                        ; Extended Roman for Slavic & Baltic langs    <21>
  65. smVietnamese      EQU         30                        ; Extended Roman for Vietnamese
  66. smExtArabic        EQU            31                        ; Extended Arabic for Sindhi, etc.        <21>
  67. smUninterp        EQU         32                        ; uninterpreted symbols, e.g. palette symbols
  68.  
  69. ; Obsolete names for script systems (kept for backward compatibility).
  70.  
  71. smChinese         EQU         2                         ; (use smTradChinese or smSimpChinese).    <14>
  72. smRussian        EQU            7                        ; (old name for smCyrillic).
  73. ;smMaldivian       EQU         25                        ; (no more smMaldivian!)                <14>
  74. smAmharic        EQU            28                        ; (old name for smGeez)
  75. smSlavic          EQU         29                        ; (old name for smEastEurRoman)
  76. smSindhi          EQU         31                        ; (old name for smExtArabic)            <21>
  77.  
  78. ; Language codes - moved to LanguageEqu.a                                                    <21>
  79.  
  80. ; Calendar Codes
  81.  
  82. calGregorian      EQU         0
  83. calArabicCivil    EQU         1
  84. calArabicLunar    EQU         2
  85. calJapanese       EQU         3
  86. calJewish         EQU         4
  87. calCoptic         EQU         5
  88. calPersian        EQU            6                        ;                                            <19> 
  89.  
  90. ; Integer Format Codes
  91.  
  92. intWestern        EQU         0
  93. intArabic         EQU         1
  94. intRoman          EQU         2
  95. intJapanese       EQU         3
  96. intEuropean       EQU         4
  97. intOutputMask     EQU         $8000
  98.  
  99. ; CharByte byte types.
  100.  
  101. smSingleByte      EQU         0
  102. smFirstByte       EQU         -1
  103. smLastByte        EQU         1
  104. smMiddleByte      EQU         2
  105.  
  106. ; CharType field masks
  107.  
  108. smcTypeMask            EQU        $000F
  109. smcReserved            EQU        $00F0
  110. smcClassMask        EQU        $0F00
  111. smcOrientationMask     EQU        $1000                    ; two-byte script glyph orientation            <27><33>
  112. smcRightMask        EQU        $2000
  113. smcUpperMask        EQU        $4000
  114. smcDoubleMask        EQU        $8000
  115.  
  116. ; Basic CharType character types.
  117.  
  118. smCharPunct       EQU         $0000
  119. smCharAscii       EQU         $0001
  120. smCharEuro        EQU         $0007
  121. smCharExtAscii    EQU         $0007                    ; More correct synonym for smCharEuro        <20>
  122.  
  123. ; Additional CharType character types for script systems.
  124.  
  125. smCharKatakana         EQU     $0002                     ; Japanese Katakana                            <32>
  126. smCharHiragana         EQU     $0003                     ; Japanese Hiragana                            <32>
  127. smCharIdeographic    EQU     $0004                     ; Hanzi, Kanji, Hanja                        <32>
  128. smCharTwoByteGreek    EQU     $0005                     ; 2-byte Greek in Far East systems            <32>
  129. smCharTwoByteRussian EQU     $0006                     ; 2-byte Cyrillic in Far East systems        <32>
  130. smCharBidirect        EQU        $0008                    ; Arabic, Hebrew                            <20>
  131. smCharHangul        EQU     $000C                     ; Korean Hangul                                <20><32>
  132. smCharJamo            EQU     $000D                     ; Korean Jamo                                <35>
  133. ; old names for above, for backward compatibility
  134. smCharFISKana         EQU     $0002                     ; Katakana
  135. smCharFISGana         EQU     $0003                     ; Hiragana
  136. smCharFISIdeo         EQU     $0004                     ; Hanzi, Kanji, Hanja
  137. smCharFISGreek        EQU     $0005                     ; 2-byte Greek in Far East systems
  138. smCharFISRussian    EQU     $0006                     ; 2-byte Cyrillic in Far East systems
  139.  
  140. ; CharType punctuation sub-types.
  141.  
  142. smPunctNormal     EQU         $0000
  143. smPunctNumber     EQU         $0100
  144. smPunctSymbol     EQU         $0200
  145. smPunctBlank      EQU         $0300                     ; NBSP is PunctNormal
  146.  
  147. ; CharType punctuation sub-types for two-byte systems                                            <27>
  148.  
  149. smPunctRepeat     EQU         $0400                     ; repeat marker                                <27><32><33>
  150. smPunctGraphic     EQU         $0500                     ; line graphics                                <27><32>
  151.  
  152. ; CharType Katakana and Hiragana sub-types for two-byte systems                                    <27>
  153.  
  154. smKanaSmall        EQU         $0100                     ; small kana character                        <27>
  155. smKanaHardOK    EQU         $0200                     ; can have dakuten                            <27>
  156. smKanaSoftOK    EQU         $0300                     ; can have dakuten or han-dakuten            <27>
  157.  
  158. ; CharType Ideographic sub-types for two-byte systems
  159.  
  160. smIdeographicLevel1    EQU     $0000                     ; level 1 char                                <32>
  161. smIdeographicLevel2    EQU     $0100                     ; level 2 char                                <32>
  162. smIdeographicUser    EQU     $0200                     ; user char                                    <32>
  163. ; old names for some of above, for backward compatibility
  164. smFISClassLvl1    EQU         $0000                     ; level 1 char                                <5><26>
  165. smFISClassLvl2    EQU         $0100                     ; level 2 char                                <5><26>
  166. smFISClassUser    EQU         $0200                     ; user char                                    <5><26>
  167.  
  168. ; CharType Jamo sub-types for Korean systems                                                    <35>
  169.  
  170. smJamoJaeum        EQU         $0000                     ; simple consonant char                        <35>
  171. smJamoBogJaeum    EQU         $0100                     ; complex consonant char                    <35>
  172. smJamoMoeum        EQU         $0200                     ; simple vowel char                            <35>
  173. smJamoBogMoeum    EQU         $0300                     ; complex consonant char                    <35>
  174.  
  175. ; CharType glyph orientation for two-byte systems                                                <27>
  176.  
  177. smCharHorizontal    EQU        $0000                    ; horizontal character form, or for both    <27>
  178. smCharVertical        EQU        $1000                    ; vertical character form                    <27>
  179.  
  180. ; CharType directions
  181.  
  182. smCharLeft        EQU         $0000
  183. smCharRight       EQU         $2000
  184.  
  185. ; CharType case modifers.
  186.  
  187. smCharLower       EQU         $0000
  188. smCharUpper       EQU         $4000
  189.  
  190. ; CharType character size modifiers (1 or multiple bytes).
  191.  
  192. smChar1byte       EQU         $0000
  193. smChar2byte       EQU         $8000
  194.  
  195. ; Char2Pixel directions.
  196.  
  197. smLeftCaret       EQU         0                         ; Place caret for left block.
  198. smRightCaret      EQU         -1                        ; Place caret for right block.
  199. smHilite          EQU         1                         ; Direction is TESysJust.
  200.  
  201. ; Transliterate target types for Roman.
  202.  
  203. smTransAscii      EQU         0                         ; convert to ASCII
  204. smTransNative     EQU         1                         ; convert to font script                <33>
  205. smTransCase       EQU         $FE                       ; convert case for all text
  206. smTransSystem     EQU         $FF                       ; convert to system script
  207.  
  208. ; Transliterate target types for two-byte scripts                                            <35>
  209.  
  210. smTransAscii1     EQU         2                         ; 1-byte Roman
  211. smTransAscii2     EQU         3                         ; 2-byte Roman
  212. smTransKana1      EQU         4                         ; 1-byte Japanese Katakana
  213. smTransKana2      EQU         5                         ; 2-byte Japanese Katakana
  214. ; (no 1-byte hiragana)
  215. smTransGana2      EQU         7                         ; 2-byte Japanese Hiragana
  216. smTransHangul2        EQU     8                         ; 2-byte Korean Hangul                    <35>
  217. smTransJamo2        EQU     9                         ; 2-byte Korean Jamo                    <35>
  218. smTransBopomofo2    EQU     10                         ; 2-byte Chinese Bopomofo                <35>
  219.  
  220. ; Transliterate target modifiers.
  221.  
  222. smTransLower      EQU         $4000                    ; target becomes lowercase                <33>
  223. smTransUpper      EQU         $8000                    ; target becomes uppercase                <33>
  224.  
  225. ; Transliterate source mask - general.
  226.  
  227. smMaskAll         EQU         $FFFFFFFF                 ; Convert all text
  228.  
  229. ; Transliterate source masks for Roman.
  230.  
  231. smMaskAscii       EQU         $00000001                 ; 2^smTransAscii
  232. smMaskNative      EQU         $00000002                 ; 2^smTransNative
  233.  
  234. ; Transliterate source masks for two-byte scripts.                                            <35>
  235.  
  236. smMaskAscii1      EQU         $00000004                 ; 2^smTransAscii1
  237. smMaskAscii2      EQU         $00000008                 ; 2^smTransAscii2
  238. smMaskKana1       EQU         $00000010                 ; 2^smTransKana1
  239. smMaskKana2       EQU         $00000020                 ; 2^smTransKana2
  240. smMaskGana2       EQU         $00000080                 ; 2^smTransGana2
  241. smMaskHangul2    EQU         $00000100                 ; 2^smTransHangul2                        <35>
  242. smMaskJamo2        EQU         $00000200                 ; 2^smTransJamo2                        <35>
  243. smMaskBopomofo2    EQU         $00000400                 ; 2^smTransBopomofo2                    <35>
  244.  
  245. ; Result values from GetEnvirons, SetEnvirons, GetScript and SetScript calls.
  246.  
  247. smNotInstalled    EQU         0                         ; routine not available in script
  248. smBadVerb         EQU         -1                        ; Bad verb passed to a routine.
  249. smBadScript       EQU         -2                        ; Bad script code passed to a routine.
  250.  
  251. ; Values for script redraw flag                                                                    <23>
  252.  
  253. smRedrawChar    EQU            0                        ; redraw character only
  254. smRedrawWord    EQU            1                        ; redraw entire word (2-byte systems)
  255. smRedrawLine    EQU            -1                        ; redraw entire line (bidirectional systems)
  256.  
  257. ; Result values from StyledLineBreak
  258.  
  259. smBreakWord       EQU         0                         ; could break at word boundary
  260. smBreakChar       EQU         1                         ; had to break at char boundary
  261. smBreakOverflow   EQU         2                         ; text too short, width subtracted
  262.  
  263. ; -----------------------------------------------------------------------------
  264. ; GetEnvirons and SetEnvirons verbs.
  265. ; -----------------------------------------------------------------------------
  266.  
  267. smVersion         EQU         0                         ; Script Manager version number.            <33>
  268. smMunged          EQU         2                         ; Globals change count.
  269. smEnabled         EQU         4                         ; Count of enabled scripts, incl Roman.        <33>
  270. smBidirect        EQU         6                         ; At least one bidirectional script.        <33>
  271. smFontForce       EQU         8                         ; Force font flag.
  272. smIntlForce       EQU         10                        ; Force intl flag.
  273. smForced          EQU         12                        ; Script was forced to system script.        <33>
  274. smDefault         EQU         14                        ; Script was defaulted to Roman script.        <33>
  275. smPrint           EQU         16                        ; Printer action routine.
  276. smSysScript       EQU         18                        ; System script.
  277. smLastScript      EQU         20                        ; Last keyboard script.
  278. smKeyScript       EQU         22                        ; Keyboard script.
  279. smSysRef          EQU         24                        ; System folder refNum.
  280. smKeyCache        EQU         26                        ; Obsolete                                    <33>
  281. smKeySwap         EQU         28                        ; Swapping table handle.                    <33>
  282. smGenFlags        EQU         30                        ; general flags long
  283. smOverride        EQU         32                        ; script override flags
  284. smCharPortion     EQU         34                        ; Ch vs SpExtra proportion
  285. ; New for System 7.0:    <2.4>
  286. smDoubleByte    EQU            36                        ; Flag for double-byte script installed        <2.4>
  287. smKCHRCache        EQU            38                        ; Returns pointer to KCHR cache                <2.6>
  288. smRegionCode    EQU            40                        ; Returns current region code (verXxx)        <3>
  289.  
  290. ; -----------------------------------------------------------------------------
  291. ; GetScript and SetScript verbs.
  292. ; Note: verbs private to script systems are negative, while
  293. ; those general across script systems are non-negative
  294. ; -----------------------------------------------------------------------------
  295.  
  296. smScriptVersion    EQU         0                         ; Script software version.
  297. smScriptMunged    EQU         2                         ; Script entry changed count.
  298. smScriptEnabled    EQU         4                         ; Script enabled flag.
  299. smScriptRight     EQU         6                         ; Right to left flag.
  300. smScriptJust      EQU         8                         ; Justification flag.
  301. smScriptRedraw    EQU         10                        ; Word redraw flag.
  302. smScriptSysFond    EQU         12                        ; Preferred system font.
  303. smScriptAppFond    EQU         14                        ; Preferred Application font.
  304. smScriptBundle    EQU         16                        ; Beginning of itlb verbs.
  305. smScriptNumber    EQU         16                        ; Script itl0 id.
  306. smScriptDate      EQU         18                        ; Script itl1 id.
  307. smScriptSort      EQU         20                        ; Script itl2 id.
  308. smScriptFlags     EQU         22                        ; Script flags
  309. smScriptToken     EQU         24                        ; Script itl4 id.
  310. smScriptEncoding EQU         26                        ; id of optional itl5, if present.            <22>
  311. smScriptLang      EQU         28                        ; Current language for script
  312. smScriptNumDate    EQU         30                        ; Script Number/Date formats
  313. smScriptKeys      EQU         32                        ; Script KCHR id.
  314. smScriptIcon      EQU         34                        ; ID # of SICN or kcs#/kcs4/kcs8 suite.
  315. smScriptPrint     EQU         36                        ; Script printer action routine.
  316. smScriptTrap      EQU         38                        ; Trap entry pointer.
  317. smScriptCreator    EQU         40                        ; Script file creator.
  318. smScriptFile      EQU         42                        ; Script file name.
  319. smScriptName      EQU         44                        ; Script name.
  320. ; There is a hole here for old Kanji private verbs 46-76
  321.  
  322. ; New for System 7.0:    <1.9>
  323. smScriptMonoFondSize EQU      78                        ; default monospace FOND (hi) & size (lo)
  324. smScriptPrefFondSize EQU      80                        ; preferred FOND (hi) & size (lo)
  325. smScriptSmallFondSize EQU     82                        ; default small FOND (hi) & size (lo)
  326. smScriptSysFondSize EQU       84                        ; default system FOND (hi) & size (lo)
  327. smScriptAppFondSize EQU       86                        ; default application FOND (hi) & size (lo)    <9>
  328. smScriptHelpFondSize EQU       88                        ; default Help Mgr FOND (hi) & size (lo)    <9>
  329. smScriptValidStyles EQU       90                        ; mask of valid styles for script            <18>
  330. smScriptAliasStyle EQU       92                        ; style (set) to use for aliases            <18>
  331.  
  332. ; -----------------------------------------------------------------------------
  333. ; Negative verbs for KeyScript                                                                <13><23>
  334. ; -----------------------------------------------------------------------------
  335.  
  336. smKeyNextScript            EQU        -1            ; Switch to next available script
  337. smKeySysScript            EQU        -2            ; Switch to the system script
  338. smKeySwapScript            EQU        -3            ; Switch to previously-used script                    <19>
  339.  
  340. ; New for System 7.0
  341. smKeyNextKybd            EQU        -4            ; Switch to next keyboard in current keyscript
  342. smKeySwapKybd            EQU        -5            ; Switch to previously-used keyboard in current keyscript
  343.                                             ;    (smKeySwapKybd is not implemented in System 7.0)
  344. smKeyDisableKybds        EQU        -6            ; Disable keyboards not in system or Roman script    <23>
  345. smKeyEnableKybds        EQU        -7            ; Re-enable keyboards for all enabled scripts        <23>
  346.  
  347. ; Not currently implemented in System, may be implemented by script systems                        <19>
  348. ; (Renumbered smKeyNextInputMethod, smKeySwapInputMethod)                                        <23>
  349. smKeyToggleInline        EQU        -8            ; Toggle inline input for current keyscript
  350. smKeyToggleDirection    EQU        -9            ; Toggle default line direction (TESysJust)
  351. smKeyNextInputMethod    EQU        -10            ; Switch to next input method in current keyscript    <23>
  352. smKeySwapInputMethod    EQU        -11            ; Switch to last-used input method in cur keyscript    <23>
  353.  
  354. smKeyDisableKybdSwitch    EQU        -12            ; Disable switching from the current keyboard        <24>
  355. ; -----------------------------------------------------------------------------
  356. ; Bits in the smScriptFlags word (bits above 7 are non-static)
  357. ; -----------------------------------------------------------------------------
  358.  
  359. smsfIntellCP      EQU         0                         ; script has intelligent cut & paste
  360. smsfSingByte      EQU         1                         ; script has only single bytes
  361. smsfNatCase       EQU         2                         ; native chars have upper & lower case
  362. smsfContext       EQU         3                         ; script is contextual                        <33>
  363. smsfNoForceFont    EQU         4                         ; script will not force characters
  364. smsfB0Digits      EQU         5                         ; script has alternate digits at B0-B9
  365. smsfAutoInit    EQU            6                        ; auto initialize the script                <8>
  366. smsfForms         EQU         13                        ; uses contextual forms for letters
  367. smsfLigatures     EQU         14                        ; uses contextual ligatures
  368. smsfReverse       EQU         15                        ; reverses native text, right-left
  369.  
  370. ; -----------------------------------------------------------------------------
  371. ; Bits in the smGenFlags long. First (high-order) byte is set from itlc flags byte.
  372. ; -----------------------------------------------------------------------------
  373. smfShowIcon        EQU    31                                ; show icon even if only one script    
  374. smfDualCaret    EQU    30                                ; use dual caret for mixed direction text
  375. smfNameTagEnab    EQU    29                                ; reserved for internal use                    <16>
  376.  
  377. ; -----------------------------------------------------------------------------
  378. ; Roman script constants.
  379. ; -----------------------------------------------------------------------------
  380.  
  381. ; The following are here for backward compatibility, but should not be used.                    <19>
  382. ; This information should be obtained using GetScript.
  383. romanSysFond    EQU    $3FFF                            ; system font id number.
  384. romanAppFond    EQU    3                                ; application font id number.
  385. romanFlags        EQU    (1<<smsfIntellCP)+(1<<smsfSingByte)+(1<<smsfNatCase)    ; roman settings
  386.  
  387. ; Script Manager font equates.
  388.  
  389. smFondStart       EQU         $4000                     ; start from 16K.
  390. smFondEnd         EQU         $C000                     ; past end of range at 48K.
  391.  
  392. ; -----------------------------------------------------------------------------
  393. ; Simple script constants.
  394. ; -----------------------------------------------------------------------------
  395. smUprHalfCharSet    EQU        $80        ; first character code in upper half of Macintosh Character Set    <8>
  396.  
  397. ; -----------------------------------------------------------------------------
  398. ; Macintosh character set extensions
  399. ; -----------------------------------------------------------------------------
  400.  
  401. diaeresisUprY     EQU         $D9                       ; Ÿ
  402. fraction          EQU         $DA                       ; ⁄
  403. intlCurrency      EQU         $DB                       ; €
  404. leftSingGuillemet    EQU     $DC                       ; ‹
  405. rightSingGuillemet    EQU        $DD                       ; ›
  406. fiLigature        EQU         $DE                       ; fi
  407. flLigature        EQU         $DF                       ; fl
  408. dblDagger         EQU         $E0                       ; ‡
  409. centeredDot       EQU         $E1                       ; ·
  410. baseSingQuote     EQU         $E2                       ; ‚
  411. baseDblQuote      EQU         $E3                       ; „
  412. perThousand       EQU         $E4                       ; ‰
  413. circumflexUprA    EQU         $E5                       ; Â
  414. circumflexUprE    EQU         $E6                       ; Ê
  415. acuteUprA         EQU         $E7                       ; Á
  416. diaeresisUprE     EQU         $E8                       ; Ë
  417. graveUprE         EQU         $E9                       ; È
  418. acuteUprI         EQU         $EA                       ; Í
  419. circumflexUprI    EQU         $EB                       ; Î
  420. diaeresisUprI     EQU         $EC                       ; Ï
  421. graveUprI         EQU         $ED                       ; Ì
  422. acuteUprO         EQU         $EE                       ; Ó
  423. circumflexUprO    EQU         $EF                       ; Ô
  424. appleLogo         EQU         $F0                       ; 
  425. graveUprO         EQU         $F1                       ; Ò
  426. acuteUprU         EQU         $F2                       ; Ú
  427. circumflexUprU    EQU         $F3                       ; Û
  428. graveUprU         EQU         $F4                       ; Ù
  429. dotlessLwrI       EQU         $F5                       ; ı
  430. circumflex        EQU         $F6                       ; ˆ
  431. tilde             EQU         $F7                       ; ˜
  432. macron            EQU         $F8                       ; ¯
  433. breveMark         EQU         $F9                       ; ˘                                        <34>
  434. overDot           EQU         $FA                       ; ˙
  435. ringMark          EQU         $FB                       ; ˚                                        <34>
  436. cedilla           EQU         $FC                       ; ¸
  437. doubleAcute       EQU         $FD                       ; ˝
  438. ogonek            EQU         $FE                       ; ˛
  439. hachek            EQU         $FF                       ; (don't type it here - breaks MPW tools!)
  440.  
  441. ; -----------------------------------------------------------------------------
  442. ; Other new constants for 7.0                                                                <2.7>
  443. ; -----------------------------------------------------------------------------
  444.  
  445. ; Constants for truncWhere argument in TruncString and TruncText                            <2.7>
  446.  
  447. smTruncEnd        EQU         0                         ; Truncate at end
  448. smTruncMiddle     EQU         $4000                     ; Truncate in middle
  449.  
  450. ; Constants for TruncString and TruncText results                                            <13>
  451.  
  452. smNotTruncated     EQU         0                        ; No truncation was necessary
  453. smTruncated        EQU         1                         ; Truncation performed
  454. smTruncErr        EQU            -1                        ; General error
  455.  
  456. ; Constants for styleRunPosition argument in NPortionText, NDrawJust, NMeasureJust,            <2>
  457. ; NChar2Pixel, and NPixel2Char.
  458.  
  459. smOnlyStyleRun    EQU         0                         ; This is the only style run on the line.
  460. smLeftStyleRun    EQU         1                         ; This is leftmost of multiple style runs on the line.
  461. smRightStyleRun   EQU         2                         ; This is rightmost of multiple style runs on the line.
  462. smMiddleStyleRun  EQU         3                         ; There are multiple style runs on the line and this…
  463.                                                     ; …is neither the leftmost nor the rightmost.
  464.  
  465. ; -----------------------------------------------------------------------------
  466. ; Record declarations for itlc, itlb, itl2, itl4
  467. ; -----------------------------------------------------------------------------
  468. ; Record declaration for international configuration resource (type itlc).
  469.  
  470. ItlcRecord        record      0
  471. itlcSystem        ds.w        1                         ; default system script.
  472. itlcReserved      ds.w        1                         ; reserved
  473. itlcFontForce     ds.b        1                         ; default font force flag.
  474. itlcIntlForce     ds.b        1                         ; default intl force flag.
  475. itlcOldKybd       ds.b        1                         ; MacPlus intl keybd flag                <33>
  476. itlcFlags         ds.b        1                         ; general flags
  477. itlcIconOffset    ds.w        1                        ; keyboard icon offset (not in 7.0)        <1.3><33>
  478. itlcIconSide    ds.b        1                        ; keybd icon side (R=0,L=$FF) (not 7.0) <1.3><33>
  479. itlcIconRsvd    ds.b        1                        ; rsvd for other icon info                <1.3><33>
  480. itlcRegionCode    ds.w        1                        ; preferred verXxx code                    <4>
  481. itlcReserved3    ds.b        34                        ; for future use                        <4><5>
  482. itlcSize          equ         *                         ; size of script itlc.
  483.                   endr
  484.  
  485. ; Record declaration for international bundle resource (type itlb).
  486.  
  487. ItlbRecord        record      0
  488. itlbNumber        ds.w        1                         ; itl0 ID number.
  489. itlbDate          ds.w        1                         ; itl1 ID number.
  490. itlbSort          ds.w        1                         ; itl2 ID number.
  491. itlbFlags         ds.w        1                         ; Script Flags.
  492. itlbToken         ds.w        1                         ; itl4 ID number.
  493. itlbEncoding     ds.w        1                         ; itl5 ID # (optional; char encoding).    <22>
  494. itlbLang          ds.w        1                         ; current language for script
  495. itlbNumRep        ds.b        1                         ; number representation code
  496. itlbDateRep       ds.b        1                         ; date representation code
  497. itlbKeys          ds.w        1                         ; KCHR id number.
  498. itlbIcon          ds.w        1                         ; ID # of SICN or kcs#/kcs4/kcs8 suite.
  499. itlbSize          equ         *                         ; size of bundle.
  500.                   endr
  501.  
  502. ; Extended itlb to support auto initialization of scripts <8>
  503. ItlbExtRecord    record    0
  504. base            ds        ItlbRecord        ; un-extended itlbRecord
  505. itlbLocalSize    ds.l    1                ; size of script's local record
  506. itlbMonoFond    ds.w    1                ; default monospace FOND ID
  507. itlbMonoSize    ds.w    1                ; default monospace font size
  508. itlbPrefFond    ds.w    1                ; preferred FOND ID
  509. itlbPrefSize    ds.w    1                ; preferred font size
  510. itlbSmallFond    ds.w    1                ; default small FOND ID
  511. itlbSmallSize    ds.w    1                ; default small font size
  512. itlbSysFond        ds.w    1                ; default system FOND ID
  513. itlbSysSize        ds.w    1                ; default system font size
  514. itlbAppFond        ds.w    1                ; default application FOND ID
  515. itlbAppSize        ds.w    1                ; default application font size
  516. itlbHelpFond    ds.w    1                ; default Help Mgr FOND ID                            <9>
  517. itlbHelpSize    ds.w    1                ; default Help Mgr font size                        <9>
  518. itlbValidStyles    ds.b    1                ; mask of valid styles for script                    <18>
  519. itlbAliasStyle    ds.b    1                ; style (set) to mark aliases                        <18>
  520. itlbExtSize        equ    *                    ; size of ItlbExtRecord
  521.                 endr
  522.                 
  523. ; itl2 routine vector offsets.
  524.  
  525. initHook          EQU         0
  526. fetchHook         EQU         2
  527. vernierHook       EQU         4
  528. projectHook       EQU         6
  529. rsvdHook          EQU         8
  530. exitHook          EQU         10
  531.  
  532. ; Note that the value of itl2FlagsOffset is equal
  533. ; to the value of rsvdHook. In the old itl2
  534. ; format the value at this location was an 
  535. ; unused routine offset. In the new itl2
  536. ; format, the value at this location is a flag
  537. ; ($ffff) indicating the new format that includes
  538. ; the offsets to the tables for LwrString and
  539. ; tables for the Roman versions of the CharType,
  540. ; Transliterate and FindWord.
  541.  
  542. itl2FlagsOffset   EQU         8
  543. ; itl2 table offsets
  544.  
  545. typeListOffset      EQU         12
  546. classArrayOffset  EQU         14
  547. upperListOffset   EQU         16
  548. lowerListOffset   EQU         18
  549. upperNoMarkListOffset EQU     20
  550. wordTableOffset   EQU         22
  551. wrapTableOffset   EQU         24
  552. noMarkListOffset  EQU         26
  553. itl2VersionOffset EQU         28
  554. itl2FormatOffset  EQU        30        ;                                    <28>
  555.  
  556. ; New for System 7.0:<2.5>
  557. ; itl2 table/code lengths.
  558.  
  559. wordTableLen            EQU    54        ;                                    <2.5>
  560. wrapTableLen            EQU    56        ;                                    <2.5>
  561. findScriptTableOffset    EQU    60        ;                                     <8>
  562. findScriptTableLen        EQU    62        ;                                     <8>
  563.  
  564. ; New for System 7.0:
  565. ; itl2FormatOffset definitions
  566. hdrExtensionsExist    EQU        1        ;                                    <28>
  567.  
  568. ; String data structure for itl2 stack frames.
  569.  
  570. IUStrData         record      0
  571. curChar           ds.w        1                         ; current character.
  572. mapChar           ds.w        1                         ; projected character.
  573. decChar           ds.w        1                         ; decision char for weak equality.
  574. bufChar           ds.b        1                         ; buffer for expansion.
  575. justAfter         ds.b        1                         ; boolean for AE vs ligature-AE.
  576. ignChar           ds.b        1                         ; flag: ignore char.
  577. noFetch           ds.b        1                         ; flag: no fetch of next.
  578. strCnt            ds.w        1                         ; length word.
  579. strPtr            ds.l        1                         ; current ptr to string.
  580.                   endr
  581.  
  582. ; Stack frame for itl2 sorting routines.
  583.  
  584. IUSortFrame       record      {oldA6},decrement
  585. result            ds.w        1
  586. aStrText          ds.l        1
  587. bStrText          ds.l        1
  588. aStrLen           ds.w        1
  589. bStrLen           ds.w        1
  590. return            ds.l        1
  591. oldA6             ds.l        1
  592. aInfo             ds          IUStrData
  593. bInfo             ds          IUStrData
  594. wantMag         ds.b        1                        ; 0 to use primary differences only; else 1        <33>
  595. weakEq            ds.b        1                        ; Signals at most weak equality.
  596. msLock            ds.b        1                        ; (obsolete, not used)
  597. weakMag         ds.b        1                        ; -1 to force magnitude result (-1,0,1); else 0    <33>
  598. supStorage        ds.b        18                        ; extra storage.
  599. weakAPtr          ds.l        1                         ; sup. pointer
  600. weakBPtr          ds.l        1                         ; sup. pointer
  601. lkSize            equ         *                         ; frame size.
  602. paramBytes        equ         aStrText-return
  603.                   endr
  604.  
  605. ; New for System 7.0:
  606. ; New stack frame for itl2 sorting routines in System 7.0; adds itl2Handle field.                    <5>
  607.  
  608. IUNSortFrame record    {oldA6},decrement
  609. result        ds.w    1
  610. aStrText    ds.l    1
  611. bStrText    ds.l    1
  612. aStrLen        ds.w    1
  613. bStrLen        ds.w    1
  614. return        ds.l    1
  615. oldA6        ds.l    1
  616. aInfo        ds    IUStrData
  617. bInfo        ds    IUStrData
  618. wantMag     ds.b    1            ; 0 to use primary differences only; else 1                            <33>
  619. weakEq        ds.b    1            ; Signals at most weak equality.
  620. msLock        ds.b    1            ; (obsolete, not used)
  621. weakMag     ds.b    1            ; -1 to force magnitude result (-1,0,1); else 0                        <33>
  622. supStorage    ds.b    18            ; extra storage.
  623. weakAPtr    ds.l    1            ; sup. pointer
  624. weakBPtr    ds.l    1            ; sup. pointer
  625. itl2Handle    ds.l    1            ; itl2 handle, if supplied                                            <2.3>
  626. lkSize        equ    *                ; frame size.
  627. paramBytes    equ    aStrText-return
  628.             endr
  629.  
  630. Itl4Rec           record      0,increment    ;                                                (added comments <33>)
  631. flags             ds.w        1            ; reserved
  632. resourceType      ds.l        1            ; contains 'itl4'
  633. resourceNum       ds.w        1            ; resource ID
  634. version           ds.w        1            ; version number
  635. resHeader1        ds.l        1            ; reserved
  636. resHeader2        ds.l        1            ; reserved
  637. numTables         ds.w        1            ; number of tables, one-based
  638.                                 ; the following offsets are from beginning of resource
  639. mapOffset         ds.l        1            ; offset to table that maps byte to token
  640. strOffset         ds.l        1            ; offset to routine that copies canonical string
  641. fetchOffset       ds.l        1            ; offset to routine that gets next byte of character
  642. unTokenOffset     ds.l        1            ; offset to table that maps token to canonical string
  643. defPartsOffset    ds.l        1            ; offset to default number parts table
  644. resOffset6        ds.l        1            ; reserved
  645. resOffset7        ds.l        1            ; reserved
  646. resOffset8        ds.l        1            ; reserved
  647. itl4HeaderSize    equ         *
  648. ; the rest is data pointed to by offsets.
  649.                   endr
  650.  
  651. ; New for System 7.0:    <5>
  652.  
  653. NItl4Rec        record    0,increment    ;                                        (added comments <33>)
  654. flags            ds.w    1            ; reserved
  655. resourceType    ds.l    1            ; contains 'itl4'
  656. resourceNum        ds.w    1            ; resource ID
  657. version            ds.w    1            ; version number
  658. format            ds.w    1            ; format code                                <29>
  659. resHeader        ds.w    1            ; reserved                                    <29>
  660. resHeader2        ds.l    1            ; reserved
  661. numTables        ds.w    1            ; number of tables, one-based
  662.                             ; the following offsets are from beginning of resource
  663. mapOffset        ds.l    1            ; offset to table that maps byte to token
  664. strOffset        ds.l    1            ; offset to routine that copies canonical string
  665. fetchOffset        ds.l    1            ; offset to routine that gets next byte of character
  666. unTokenOffset    ds.l    1            ; offset to table that maps token to canonical string
  667. defPartsOffset    ds.l    1            ; offset to default number parts table
  668. whtSpListOffset    ds.l    1            ; offset to white space code list            <2.3><15>
  669. resOffset7        ds.l    1            ; reserved
  670. resOffset8        ds.l    1            ; reserved
  671. resLength1        ds.w    1            ; reserved                                    <2.5>
  672. resLength2        ds.w    1            ; reserved                                    <2.5>
  673. resLength3        ds.w    1            ; reserved                                    <2.5>
  674. unTokenLength    ds.w    1            ; length of untoken table                    <2.5><9>
  675. defPartsLength    ds.w    1            ; length of default number parts table        <2.5><9>
  676. whtSpListLength    ds.w    1            ; length of white space code list            <2.5><9><20>
  677. resLength7        ds.w    1            ; reserved                                    <2.5>
  678. resLength8        ds.w    1            ; reserved                                    <2.5>
  679. nItl4HeaderSize    equ        *            ;                                            <22>
  680. ; the rest is data pointed to by offsets.
  681.             endr
  682.  
  683. ; -----------------------------------------------------------------------------
  684. ; Record declarations and constants for date/time/location handling
  685. ; -----------------------------------------------------------------------------
  686.  
  687. LongDateRec       record      0                         ; zero any fields not used!
  688. era               ds.w        1
  689. year              ds.w        1
  690. month             ds.w        1
  691. day               ds.w        1
  692. hour              ds.w        1
  693. minute            ds.w        1
  694. second            ds.w        1
  695. dayOfWeek         ds.w        1
  696. dayOfYear         ds.w        1
  697. weekOfYear        ds.w        1
  698. pm                ds.w        1
  699. ldReserved        ds.w        3
  700. LongDateRecSize   equ         *
  701.                   endR
  702.  
  703. LongDateTime      record      0                         ; record for comp type
  704. highLong          ds.l        1
  705. lowLong           ds.l        1
  706.                   endR
  707.  
  708. ; date equates constants
  709.  
  710. LongDateField     record      0                         ;DateField: enum type
  711. eraField          ds.b        1
  712. yearField         ds.b        1
  713. monthField        ds.b        1
  714. dayField          ds.b        1
  715. hourField         ds.b        1
  716. minuteField       ds.b        1
  717. secondField       ds.b        1
  718. dayOfWeekField    ds.b        1
  719. dayOfYearField    ds.b        1
  720. weekOfYearField   ds.b        1
  721. pmField           ds.b        1
  722. res1Field         ds.b        1
  723. res2Field         ds.b        1
  724. res3Field         ds.b        1
  725.  
  726. maxDateField      equ         pmField                   ; currently largest used field
  727.  
  728. eraMask           equ         1<<eraField
  729. yearMask          equ         1<<yearField
  730. monthMask         equ         1<<monthField
  731. dayMask           equ         1<<dayField
  732. hourMask          equ         1<<hourField
  733. minuteMask        equ         1<<minuteField
  734. secondMask        equ         1<<secondField
  735. dayOfWeekMask     equ         1<<dayOfWeekField
  736. dayOfYearMask     equ         1<<dayOfYearField
  737. weekOfYearMask    equ         1<<weekOfYearField
  738. pmMask            equ         1<<pmField
  739.  
  740. dateStdMask       equ         eraMask++yearMask++monthMask++dayMask++hourMask++minuteMask++secondMask
  741.                   endR
  742.  
  743. smallDateBit      EQU         31                        ; Restrict valid date/time to range of Time global
  744. togChar12HourBit  EQU         30                        ; If toggling hour by char, accept hours 1..12 only
  745. togCharZCycleBit  EQU         29                        ; Modifier for togChar12HourBit: accept hours 0..11 only
  746. togDelta12HourBit EQU         28                        ; If toggling hour up/down, restrict to 12-hour range (am/pm)
  747. genCdevRangeBit   EQU         27                        ; Restrict date/time to range used by genl CDEV
  748. validDateFields   EQU         -1
  749.  
  750.  
  751. TogglePB          record      0
  752. togFlags         ds.l        1                         ; longint; caller normally sets low word to dateStdMask = $7F
  753. amChars          ds.l        1                         ; ResType; from 'itl0', but uppercased                <33>
  754. pmChars          ds.l        1                         ; ResType; from 'itl0', but uppercased                <33>
  755. reserved         ds.l        4                         ; array [0..3] of Longint
  756.                   endR
  757.  
  758. ToggleResults     record      0
  759. toggleUndefined   ds.b        1
  760. toggleOk          ds.b        1
  761. toggleBadField    ds.b        1
  762. toggleBadDelta    ds.b        1
  763. toggleBadChar     ds.b        1
  764. toggleUnknown     ds.b        1
  765. toggleBadNum      ds.b        1                         ; can't use char as number
  766. toggleOutOfRange  EQU         *                         ; synonym for toggleErr3
  767. toggleErr3        ds.b        1                         ; reserved
  768. toggleErr4        ds.b        1                         ; reserved
  769. toggleErr5        ds.b        1                         ; reserved
  770.                   endR
  771.  
  772. MachineLocation   record      0
  773. latitude          ds.l        1                         ; fract
  774. longitude         ds.l        1                         ; fract
  775. dlsDelta          ds.b        1                         ; signed byte
  776. gmtDelta          ds.b        3                         ; 3 byte signed integer
  777.                   endR
  778.  
  779.  
  780. ; String2Date/String2Time status values
  781.  
  782. fatalDateTime        EQU     $8000                     ; String2Date and String2Time mask to a fatal error
  783. longDateFound        EQU     1                         ; String2Date mask to long date found
  784. leftOverChars        EQU     2                         ; String2Date & Time mask to warn of left over characters
  785. sepNotIntlSep        EQU     4                         ; String2Date & Time mask to warn of non-standard separators
  786. fieldOrderNotIntl    EQU     8                         ; String2Date & Time mask to warn of non-standard field order
  787. extraneousStrings    EQU     16                        ; String2Date & Time mask to warn of unparsable strings in text
  788. tooManySeps            EQU     32                        ; String2Date & Time mask to warn of too many separators
  789. sepNotConsistent    EQU     64                        ; String2Date & Time mask to warn of inconsistent separators
  790. tokenErr            EQU     fatalDateTime + 256       ; String2Date & Time mask for 'tokenizer err encountered'
  791. cantReadUtilities    EQU     fatalDateTime + 512       ;
  792. dateTimeNotFound    EQU     fatalDateTime + 1024      ; String2Date mask for 'date was not found'
  793. dateTimeInvalid        EQU     fatalDateTime + 2048      ; Invalid time/date e.g. 13:61PM
  794.  
  795.  
  796. DateOrders        RECORD      0,INCREMENT
  797. mdy               DS.B        1
  798. dmy               DS.B        1
  799. ymd               DS.B        1
  800. myd               DS.B        1
  801. dym               DS.B        1
  802. ydm               DS.B        1
  803.                   ENDR
  804.  
  805. ; -----------------------------------------------------------------------------
  806. ;  Constants and record declarations for tokenizer                            (added comments <33>)
  807. ; -----------------------------------------------------------------------------
  808.  
  809. tokenIntl         EQU         4             ; the itl resource number for the tokenizer
  810.  
  811. tokenEmpty        EQU         -1            ; used internally as an empty flag
  812. tokenUnknown      EQU         0            ; chars that do not match a defined token type
  813. tokenWhite        EQU         1            ; white space
  814. tokenLeftLit      EQU         2            ; literal begin
  815. tokenRightLit     EQU         3            ; literal end
  816. tokenAlpha        EQU         4            ; alphabetic
  817. tokenNumeric      EQU         5            ; numeric
  818. tokenNewLine      EQU         6            ; new line
  819. tokenLeftComment  EQU         7            ; open comment
  820. tokenRightComment EQU         8            ; close comment
  821. tokenLiteral      EQU         9            ; literal
  822. tokenEscape       EQU         10            ; character escape (e.g. '\' in "\n", "\t")
  823. tokenAltNum       EQU         11            ; alternate number (e.g. $B0-B9 in Arabic,Hebrew)
  824. tokenRealNum      EQU         12            ; real number
  825. tokenAltReal      EQU         13            ; alternate real number
  826. tokenReserve1     EQU         14            ; reserved
  827. tokenReserve2     EQU         15            ; reserved
  828. tokenLeftParen    EQU         16            ; open parenthesis
  829. tokenRightParen   EQU         17            ; close parenthesis
  830. tokenLeftBracket  EQU         18            ; open square bracket
  831. tokenRightBracket EQU         19            ; close square bracket
  832. tokenLeftCurly    EQU         20            ; open curly bracket
  833. tokenRightCurly   EQU         21            ; close curly bracket
  834. tokenLeftEnclose  EQU         22            ; open guillemet
  835. tokenRightEnclose EQU         23            ; close guillemet
  836. tokenPlus         EQU         24
  837. tokenMinus        EQU         25
  838. tokenAsterisk     EQU         26            ; times/multiply
  839. tokenDivide       EQU         27
  840. tokenPlusMinus    EQU         28            ; plus or minus symbol
  841. tokenSlash        EQU         29
  842. tokenBackSlash    EQU         30
  843. tokenLess         EQU         31            ; less than symbol
  844. tokenGreat        EQU         32            ; greater than symbol
  845. tokenEqual        EQU         33
  846. tokenLessEqual2   EQU         34            ; less than or equal, 2 characters (e.g. <=)
  847. tokenLessEqual1   EQU         35            ; less than or equal, 1 character
  848. tokenGreatEqual2  EQU         36            ; greater than or equal, 2 characters (e.g. >=)
  849. tokenGreatEqual1  EQU         37            ; greater than or equal, 1 character
  850. token2Equal       EQU         38            ; double equal (e.g. ==)
  851. tokenColonEqual   EQU         39            ; colon equal
  852. tokenNotEqual     EQU         40            ; not equal, 1 character
  853. tokenLessGreat    EQU         41            ; less/greater, Pascal not equal (e.g. <>)
  854. tokenExclamEqual  EQU         42            ; exclamation equal, C not equal (e.g. !=)
  855. tokenExclam       EQU         43            ; exclamation point
  856. tokenTilde        EQU         44            ; centered tilde                        (fix spelling <15>)
  857. tokenComma        EQU         45
  858. tokenPeriod       EQU         46
  859. tokenLeft2Quote   EQU         47            ; open double quote
  860. tokenRight2Quote  EQU         48            ; close double quote
  861. tokenLeft1Quote   EQU         49            ; open single quote
  862. tokenRight1Quote  EQU         50            ; close single quote
  863. token2Quote       EQU         51            ; double quote
  864. token1Quote       EQU         52            ; single quote
  865. tokenSemicolon    EQU         53
  866. tokenPercent      EQU         54
  867. tokenCaret        EQU         55            ;                                        (fix spelling <33>)
  868. tokenUnderline    EQU         56
  869. tokenAmpersand    EQU         57
  870. tokenAtSign       EQU         58
  871. tokenBar          EQU         59            ; vertical bar
  872. tokenQuestion     EQU         60
  873. tokenPi           EQU         61            ; lower-case pi
  874. tokenRoot         EQU         62            ; square root symbol
  875. tokenSigma        EQU         63            ; capital sigma
  876. tokenIntegral     EQU         64            ; integral sign
  877. tokenMicro        EQU         65
  878. tokenCapPi        EQU         66            ; capital pi
  879. tokenInfinity     EQU         67
  880. tokenColon        EQU         68
  881. tokenHash         EQU         69            ; e.g. #
  882. tokenDollar       EQU         70
  883. tokenNoBreakSpace EQU         71            ; non-breaking space
  884. tokenFraction     EQU         72
  885. tokenIntlCurrency EQU         73
  886. tokenLeftSingGuillemet EQU    74
  887. tokenRightSingGuillemet EQU   75        ;                                    (Fixed spelling <19>)
  888. tokenPerThousand  EQU         76
  889. tokenEllipsis    EQU         77            ;                                            <15>
  890. tokenCenterDot    EQU         78            ;                                            <15>
  891. tokenNil          EQU         127
  892.  
  893. delimPad          EQU         -2
  894.  
  895. ; obsolete, misspelled token names kept for backward compatibility            (moved here <33>)
  896.  
  897. tokenTilda        EQU         44            ; keep wrong spelling for backward compatibility <15>
  898. tokenCarat        EQU         55
  899.  
  900. TokenResults      record      0
  901. tokenOK           ds.b        1
  902. tokenOverflow     ds.b        1
  903. stringOverflow    ds.b        1
  904. badDelim          ds.b        1
  905. badEnding         ds.b        1
  906. crash             ds.b        1
  907.                   endr
  908.  
  909. TokenBlock        RECORD      0,INCR                    ;                                    (added comments <33>)
  910. source            ds.l        1                        ; pointer to stream of characters
  911. sourceLength      ds.l        1                        ; length of source stream
  912. tokenList         ds.l        1                        ; pointer to array of tokens
  913. tokenLength       ds.l        1                        ; maximum length of TokenList
  914. tokenCount        ds.l        1                        ; number tokens generated by tokenizer
  915. stringList        ds.l        1                        ; pointer to stream of identifiers
  916. stringLength      ds.l        1                        ; length of string list
  917. stringCount       ds.l        1                        ; number of bytes currently used
  918. doString          ds.b        1                        ; Boolean: make strings & put into StringList
  919. doAppend          ds.b        1                        ; Boolean: append to TokenList rather than replace
  920. doAlphanumeric    ds.b        1                        ; Boolean: identifiers may include numeric
  921. doNest            ds.b        1                        ; Boolean: do comments nest?
  922. leftDelims        ds.w        2
  923. rightDelims       ds.w        2
  924. leftComment       ds.l        2
  925. rightComment      ds.l        2
  926. escapeCode        ds.w        1                        ; escape symbol code
  927. decimalCode       ds.w        1
  928. itlResource       ds.l        1                        ; handle to itl4 resource of current script
  929. reserved          ds.l        8                         ; must be zero!
  930.                   ENDR
  931.  
  932. TokenRec          RECORD      0,INCR                    ;                                    (added comments <33>)
  933. theToken          ds.w        1                        ; TokenType
  934. position          ds.l        1                        ; Ptr into original source
  935. length            ds.l        1                        ; length of text in original source
  936. stringPosition    ds.l        1                        ; StringPtr to copy of identifier
  937. tokenRecSize      equ         *
  938.                   ENDR
  939.  
  940. UntokenTable      Record      0, INCR
  941. len               ds.w        1
  942. lastToken         ds.w        1
  943. index             ds.w        256                       ; index table; last = lastToken
  944. ;list of pascal strings here. index pointers are from front of table
  945.                   Endr
  946.  
  947. ; -----------------------------------------------------------------------------
  948. ; Record declarations and constants for formatted number handling
  949. ; -----------------------------------------------------------------------------
  950.  
  951. ; FormatClass enumeration
  952.  
  953. fPositive         EQU         0
  954. fNegative         EQU         1
  955. fZero             EQU         2
  956.  
  957. ; FormatResultType enumeration
  958.  
  959. fFormatOK         EQU         0
  960. fBestGuess        EQU         1
  961. fOutOfSynch       EQU         2
  962. fSpuriousChars    EQU         3
  963. fMissingDelimiter EQU         4
  964. fExtraDecimal     EQU         5
  965. fMissingLiteral   EQU         6
  966. fExtraExp         EQU         7
  967. fFormatOverflow   EQU         8
  968. fFormStrIsNAN     EQU         9
  969. fBadPartsTable    EQU         10
  970. fExtraPercent     EQU         11
  971. fExtraSeparator   EQU         12
  972. fEmptyFormatString EQU        13
  973.  
  974. WideChar          record      0,increment
  975. a                 ds.b        2                         ; PACKED ARRAY[0..1] OF CHAR
  976.                   ORG         a
  977. b                 ds.w        1                         ; INTEGER
  978.                   endr
  979.  
  980. WideCharArr       record      0,increment
  981. size              ds.w        1                         ; INTEGER
  982. data              ds.w        10                        ; PACKED ARRAY[0..9] OF WideChar
  983.                   endr
  984.  
  985. fVNumber          EQU         0                         ; first version of NumFormatString
  986.  
  987. NumFormatString   record      0,increment
  988. fLength           ds.b        1                         ; length of format String
  989. fVersion          ds.b        1                         ; version number
  990. data            ds.b        254                        ; private data                                <33>
  991.                   endr
  992.  
  993. ;Number format equates
  994.  
  995. tokLeftQuote      EQU         1
  996. tokRightQuote     EQU         2
  997. tokLeadPlacer     EQU         3
  998. tokLeader         EQU         4
  999. tokNonLeader      EQU         5
  1000. tokZeroLead       EQU         6
  1001. tokPercent        EQU         7
  1002. tokPlusSign       EQU         8
  1003. tokMinusSign      EQU         9
  1004. tokThousands      EQU         10
  1005. tokSeparator      EQU         12                        ; 11 is reserved
  1006. tokEscape         EQU         13
  1007. tokDecPoint       EQU         14
  1008. tokEPlus          EQU         15
  1009. tokEMinus         EQU         16
  1010. tokMaxSymbols     EQU         31
  1011.  
  1012. NumberParts       record      0,increment
  1013. version           ds.w        1                         ; integer
  1014. data              ds.w        tokMaxSymbols             ; ARRAY[tokLeftQuote..tokMaxSymbols] OF WideChar
  1015. pePlus            ds          WideCharArr               ; 64
  1016. peMinus           ds          WideCharArr               ; 86
  1017. peMinusPlus       ds          WideCharArr               ; 108
  1018. altNumTable       ds          WideCharArr               ; 130
  1019. reserved          ds.b        20
  1020. numberPartsSize   equ         *
  1021. curNumberPartsVersion equ     1
  1022.                   endr
  1023.  
  1024.  
  1025. FVector           record      0,increment
  1026. start             ds.w        1                         ; INTEGER
  1027. length            ds.w        1                         ; INTEGER
  1028.                   endr
  1029.  
  1030. TripleInt         record      0,increment
  1031. zzz1              ds          FVector
  1032. zzz2              ds          FVector
  1033. zzz3              ds          FVector
  1034.                   endr
  1035.  
  1036. ; -----------------------------------------------------------------------------
  1037. ; Record for FindScriptRun result
  1038. ; -----------------------------------------------------------------------------
  1039.  
  1040. ScriptRunStatus   record      0,increment
  1041. script            ds.b        1
  1042. variant           ds.b        1
  1043.                   endr
  1044.  
  1045. ; -----------------------------------------------------------------------------
  1046. ; Selectors and macros for the Script Manager trap call, _ScriptUtil
  1047. ; -----------------------------------------------------------------------------
  1048.  
  1049.                   Macro
  1050.                   DefSMgrRoutine &name,&selector,&argSize,&returnSize
  1051.                   sm&name:    equ &selector**$FFFF
  1052.                   smSel&name: equ (1<<31)++(&returnSize<<24)++(&argSize<<16)++sm&name
  1053.                   endm
  1054.  
  1055. ; Trap routine selectors: script manager 1.0
  1056.  
  1057. smFontScript      EQU         0
  1058. smIntlScript      EQU         2
  1059. smKybdScript      EQU         4
  1060. smFont2Script     EQU         6
  1061. smGetEnvirons     EQU         8
  1062. smSetEnvirons     EQU         10
  1063. smGetScript       EQU         12
  1064. smSetScript       EQU         14
  1065. smHighCall        EQU         smSetScript               ; boundary between script mgr & script systems
  1066. smCharByte        EQU         16
  1067. smCharType        EQU         18
  1068. smPixel2Char      EQU         20
  1069. smChar2Pixel      EQU         22
  1070. smTranslit        EQU         24
  1071. smFindWord        EQU         26
  1072. smHiliteText      EQU         28
  1073. smDrawJust        EQU         30
  1074. smMeasureJust     EQU         32
  1075. smParseTable      EQU         34
  1076.  
  1077. ; Full Trap routine selectors: script manager 1.0
  1078.  
  1079. ; format                     newBit  return/args
  1080. smSelFontScript        EQU     (1<<31)++($0200<<16)++smFontScript
  1081. smSelIntlScript        EQU     (1<<31)++($0200<<16)++smIntlScript
  1082. smSelKybdScript        EQU     (1<<31)++($0002<<16)++smKybdScript
  1083. smSelFont2Script    EQU     (1<<31)++($0202<<16)++smFont2Script
  1084. smSelGetEnvirons    EQU     (1<<31)++($0402<<16)++smGetEnvirons
  1085. smSelSetEnvirons    EQU     (1<<31)++($0206<<16)++smSetEnvirons
  1086. smSelGetScript        EQU     (1<<31)++($0404<<16)++smGetScript
  1087. smSelSetScript        EQU     (1<<31)++($0208<<16)++smSetScript
  1088. smSelCharType        EQU     (1<<31)++($0206<<16)++smCharType
  1089. smSelCharByte        EQU     (1<<31)++($0206<<16)++smCharByte
  1090. smSelPixel2Char        EQU     (1<<31)++($020E<<16)++smPixel2Char
  1091. smSelChar2Pixel        EQU     (1<<31)++($020C<<16)++smChar2Pixel
  1092. smSelTranslit        EQU     (1<<31)++($020E<<16)++smTranslit
  1093. smSelFindWord        EQU     (1<<31)++($0012<<16)++smFindWord
  1094. smSelHiliteText        EQU     (1<<31)++($000E<<16)++smHiliteText
  1095. smSelDrawJust        EQU     (1<<31)++($0008<<16)++smDrawJust
  1096. smSelMeasureJust    EQU     (1<<31)++($000C<<16)++smMeasureJust
  1097. smSelParseTable        EQU     (1<<31)++($0204<<16)++smParseTable
  1098.  
  1099. ; selectors for general script manager 2.0 routines
  1100.  
  1101.         DefSmgrRoutine StyledLineBreak, -2,28,2
  1102.         DefSmgrRoutine GetFormatOrder, -4,18,0
  1103.         DefSmgrRoutine IntlTokenize, -6,4,2
  1104.  
  1105.         DefSmgrRoutine InitDateCache, -8,4,2
  1106.         DefSmgrRoutine String2Date, -10,20,2
  1107.         DefSmgrRoutine String2Time, -12,20,2
  1108.  
  1109.         DefSmgrRoutine LongDate2Secs, -14,8,0
  1110.         DefSmgrRoutine LongSecs2Date, -16,8,0
  1111.         DefSmgrRoutine ToggleDate, -18,14,2
  1112.  
  1113.         DefSmgrRoutine Str2Format, -20,12,2
  1114.         DefSmgrRoutine Format2Str, -22,16,2
  1115.         DefSmgrRoutine FormatX2Str, -24,16,2
  1116.         DefSmgrRoutine FormatStr2X, -26,16,2
  1117.         DefSmgrRoutine ValidDate, -28,12,2
  1118.  
  1119. ; selectors for script-specific script manager 2.0 routines
  1120.  
  1121.         DefSmgrRoutine PortionText, 36,8,4
  1122.         DefSmgrRoutine FindScriptRun, 38,12,2
  1123.         DefSmgrRoutine VisibleLength, 40,8,4
  1124.         DefSmgrRoutine IsSpecialFont, 42,2,2
  1125.         DefSmgrRoutine RawPrinterValues, 44,22,2
  1126.  
  1127. ; selectors for general script manager 7.0 routines                                    <2.1><2.4>
  1128.  
  1129.         DefSmgrRoutine    NFindWord, -30,18,0            ; smSel… = $8012FFE2            <2.3>
  1130.         DefSmgrRoutine    TruncString, -32,8,2        ; smSel… = $8208FFE0            <2.3><2.7><6>
  1131.         DefSmgrRoutine    TruncText, -34,12,2            ; smSel… = $820CFFDE            <2.3><2.7><6>
  1132.         DefSmgrRoutine    ReplaceText, -36,12,2        ; smSel… = $820CFFDC            <2.3>
  1133.  
  1134. ; selectors for script-specific script manager 7.0 routines                                <2>
  1135.  
  1136.         DefSmgrRoutine    NPixel2Char,    46,34,2        ;     $8222002E                        <2><17>
  1137.         DefSmgrRoutine    NChar2Pixel,    48,28,2        ;     $821C0030                        <2><17>
  1138.         DefSmgrRoutine    NDrawJust,        50,22,0        ;     $80160032                        <2><17>
  1139.         DefSmgrRoutine    NMeasureJust,    52,26,0        ;     $801A0034                        <2><17>
  1140.         DefSmgrRoutine    NPortionText,    54,18,4        ;     $84120036                        <2><17>
  1141.         
  1142. ; moved definition of sisHighCall and fisHighCall to ScriptPriv.a                         <2>
  1143.  
  1144. ;------------------------------------------------------------------------------
  1145. ; Trap routine macros: Script Manager 1.0
  1146.  
  1147.                   macro
  1148.                   _FontScript
  1149.                   move.l      #smSelFontScript,-(sp)
  1150.                   _ScriptUtil
  1151.                   endm
  1152.  
  1153.                   macro
  1154.                   _IntlScript
  1155.                   move.l      #smSelIntlScript,-(sp)
  1156.                   _ScriptUtil
  1157.                   endm
  1158.  
  1159.                   macro
  1160.                   _KeyScript
  1161.                   move.l      #smSelKybdScript,-(sp)
  1162.                   _ScriptUtil
  1163.                   endm
  1164.  
  1165.                   macro
  1166.                   _Font2Script
  1167.                   move.l      #smSelFont2Script,-(sp)
  1168.                   _ScriptUtil
  1169.                   endm
  1170.  
  1171.                   macro
  1172.                   _GetEnvirons
  1173.                   move.l      #smSelGetEnvirons,-(sp)
  1174.                   _ScriptUtil
  1175.                   endm
  1176.  
  1177.                   macro
  1178.                   _SetEnvirons
  1179.                   move.l      #smSelSetEnvirons,-(sp)
  1180.                   _ScriptUtil
  1181.                   endm
  1182.  
  1183.                   macro
  1184.                   _GetScript
  1185.                   move.l      #smSelGetScript,-(sp)
  1186.                   _ScriptUtil
  1187.                   endm
  1188.  
  1189.                   macro
  1190.                   _SetScript
  1191.                   move.l      #smSelSetScript,-(sp)
  1192.                   _ScriptUtil
  1193.                   endm
  1194.  
  1195.                   macro
  1196.                   _CharByte
  1197.                   move.l      #smSelCharByte,-(sp)
  1198.                   _ScriptUtil
  1199.                   endm
  1200.  
  1201.                   macro
  1202.                   _CharType
  1203.                   move.l      #smSelCharType,-(sp)
  1204.                   _ScriptUtil
  1205.                   endm
  1206.  
  1207.                   macro
  1208.                   _Pixel2Char
  1209.                   move.l      #smSelPixel2Char,-(sp)
  1210.                   _ScriptUtil
  1211.                   endm
  1212.  
  1213.                   macro
  1214.                   _Char2Pixel
  1215.                   move.l      #smSelChar2Pixel,-(sp)
  1216.                   _ScriptUtil
  1217.                   endm
  1218.  
  1219.                   macro
  1220.                   _Transliterate
  1221.                   move.l      #smSelTranslit,-(sp)
  1222.                   _ScriptUtil
  1223.                   endm
  1224.  
  1225.                   macro
  1226.                   _FindWord
  1227.                   move.l      #smSelFindWord,-(sp)
  1228.                   _ScriptUtil
  1229.                   endm
  1230.  
  1231.                   macro
  1232.                   _HiliteText
  1233.                   move.l      #smSelHiliteText,-(sp)
  1234.                   _ScriptUtil
  1235.                   endm
  1236.  
  1237.                   macro
  1238.                   _DrawJust
  1239.                   move.l      #smSelDrawJust,-(sp)
  1240.                   _ScriptUtil
  1241.                   endm
  1242.  
  1243.                   macro
  1244.                   _MeasureJust
  1245.                   move.l      #smSelMeasureJust,-(sp)
  1246.                   _ScriptUtil
  1247.                   endm
  1248.  
  1249.                   macro
  1250.                   _ParseTable
  1251.                   move.l      #smSelParseTable,-(sp)
  1252.                   _ScriptUtil
  1253.                   endm
  1254.  
  1255. ;------------------------------------------------------------------------------
  1256. ; Trap routine macros: Script Manager 2.0
  1257.  
  1258.                   macro
  1259.                   _GetFormatOrder
  1260.                   move.l      #smSelGetFormatOrder,-(sp)
  1261.                   _ScriptUtil
  1262.                   endm
  1263.  
  1264.                   macro
  1265.                   _StyledLineBreak
  1266.                   move.l      #smSelStyledLineBreak,-(sp)
  1267.                   _ScriptUtil
  1268.                   endm
  1269.  
  1270.                   macro
  1271.                   _IntlTokenize
  1272.                   move.l      #smSelIntlTokenize,-(sp)
  1273.                   _ScriptUtil
  1274.                   endm
  1275.  
  1276.                   macro
  1277.                   _InitDateCache
  1278.                   move.l      #smSelInitDateCache,-(sp)
  1279.                   _ScriptUtil
  1280.                   endm
  1281.  
  1282.                   macro
  1283.                   _String2Date
  1284.                   move.l      #smSelString2Date,-(sp)
  1285.                   _ScriptUtil
  1286.                   endm
  1287.  
  1288.                   macro
  1289.                   _String2Time
  1290.                   move.l      #smSelString2Time,-(sp)
  1291.                   _ScriptUtil
  1292.                   endm
  1293.  
  1294.                   macro
  1295.                   _LongSecs2Date
  1296.                   move.l      #smSelLongSecs2Date,-(sp)
  1297.                   _ScriptUtil
  1298.                   endm
  1299.  
  1300.                   macro
  1301.                   _LongDate2Secs
  1302.                   move.l      #smSelLongDate2Secs,-(sp)
  1303.                   _ScriptUtil
  1304.                   endm
  1305.  
  1306.                   macro
  1307.                   _Str2Format
  1308.                   move.l      #smSelStr2Format,-(sp)
  1309.                   _ScriptUtil
  1310.                   endm
  1311.  
  1312.                   macro
  1313.                   _Format2Str
  1314.                   move.l      #smSelFormat2Str,-(sp)
  1315.                   _ScriptUtil
  1316.                   endm
  1317.  
  1318.                   macro
  1319.                   _FormatX2Str
  1320.                   move.l      #smSelFormatX2Str,-(sp)
  1321.                   _ScriptUtil
  1322.                   endm
  1323.  
  1324.                   macro
  1325.                   _FormatStr2X
  1326.                   move.l      #smSelFormatStr2X,-(sp)
  1327.                   _ScriptUtil
  1328.                   endm
  1329.  
  1330.                   macro
  1331.                   _ValidDate
  1332.                   move.l      #smSelValidDate,-(sp)
  1333.                   _ScriptUtil
  1334.                   endm
  1335.  
  1336.                   macro
  1337.                   _ToggleDate
  1338.                   move.l      #smSelToggleDate,-(sp)
  1339.                   _ScriptUtil
  1340.                   endm
  1341.  
  1342.                   macro
  1343.                   _PortionText
  1344.                   move.l      #smSelPortionText,-(sp)
  1345.                   _ScriptUtil
  1346.                   endm
  1347.  
  1348.                   macro
  1349.                   _FindScriptRun
  1350.                   move.l      #smSelFindScriptRun,-(sp)
  1351.                   _ScriptUtil
  1352.                   endm
  1353.  
  1354.                   macro
  1355.                   _ReadLocation
  1356.                   movea.l     (sp)+,A0
  1357.                   move.l      #$000C00E4,D0
  1358.                   _ReadXPRam
  1359.                   endm
  1360.  
  1361.                   macro
  1362.                   _WriteLocation
  1363.                   movea.l     (sp)+,A0
  1364.                   move.l      #$000C00E4,D0
  1365.                   _WriteXPRam
  1366.                   endm
  1367.  
  1368.                   macro
  1369.                   _VisibleLength
  1370.                   move.l      #smSelVisibleLength,-(sp)
  1371.                   _ScriptUtil
  1372.                   endm
  1373.  
  1374.                   macro
  1375.                   _IsSpecialFont
  1376.                   move.l      #smSelIsSpecialFont,-(sp)
  1377.                   _ScriptUtil
  1378.                   endm
  1379.  
  1380.                   macro
  1381.                   _RawPrinterValues
  1382.                   move.l      #smSelRawPrinterValues,-(sp)
  1383.                   _ScriptUtil
  1384.                   endm
  1385.  
  1386.  
  1387. ;------------------------------------------------------------------------------
  1388. ; Trap routine macros: Script Manager 7.0                    <2.1>
  1389.  
  1390.                 macro
  1391.                 _NFindWord                                    ; <2.3>
  1392.                 move.l      #smSelNFindWord,-(sp)
  1393.                 _ScriptUtil
  1394.                 endm
  1395.         
  1396.                 macro
  1397.                 _TruncString                                ; <2.3>
  1398.                 move.l      #smSelTruncString,-(sp)
  1399.                 _ScriptUtil
  1400.                 endm
  1401.         
  1402.                 macro
  1403.                 _TruncText                                    ; <2.3>
  1404.                 move.l      #smSelTruncText,-(sp)
  1405.                 _ScriptUtil
  1406.                 endm
  1407.         
  1408.                 macro
  1409.                 _ReplaceText                                ; <2.3>
  1410.                 move.l      #smSelReplaceText,-(sp)
  1411.                 _ScriptUtil
  1412.                 endm
  1413.         
  1414.                 macro
  1415.                 _NPixel2Char                                ;    <2>
  1416.                 move.l      #smSelNPixel2Char,-(sp)
  1417.                 _ScriptUtil
  1418.                 endm
  1419.         
  1420.                 macro
  1421.                 _NChar2Pixel                                ;    <2>
  1422.                 move.l      #smSelNChar2Pixel,-(sp)
  1423.                 _ScriptUtil
  1424.                 endm
  1425.         
  1426.                 macro
  1427.                 _NDrawJust                                    ;    <2>
  1428.                 move.l      #smSelNDrawJust,-(sp)
  1429.                 _ScriptUtil
  1430.                 endm
  1431.         
  1432.                 macro
  1433.                 _NMeasureJust                                ;    <2>
  1434.                 move.l      #smSelNMeasureJust,-(sp)
  1435.                 _ScriptUtil
  1436.                 endm
  1437.         
  1438.                 macro
  1439.                 _NPortionText                                ;    <2>
  1440.                   move.l      #smSelNPortionText,-(sp)
  1441.                   _ScriptUtil
  1442.                   endm
  1443.  
  1444.     ENDIF    ; ...already included